/**
 * $Id: SoftwareEngineer.java 91 2012-12-28 12:29:08Z Denis.Skalsky@gmail.com $ 
 */
package com.globallogic.skalskyy.javabasic.valstaff;

/**
 * SoftwareEngineer stores info of software developer.
 * @author $Author: Denis.Skalsky@gmail.com $
 * @version $Revision: 91 $
 */
public class SoftwareEngineer extends Employee {
	
	/** Language of programming */
	private Field<String> language = new Field<String>();

	public String getLanguage() {
		return language.getValue();
	}

	public void setLanguage(String language) {
		this.language.setValue(language);
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result
				+ ((language == null) ? 0 : language.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		SoftwareEngineer other = (SoftwareEngineer) obj;
		if (language == null) {
			if (other.language != null)
				return false;
		} else if (!language.equals(other.language))
			return false;
		return true;
	}
	
	/**
	 * Check language for a match ignoring case
	 * @param language language for checking 
	 * @return true if matches else false
	 */
	public boolean compareLanguage(String language) {
		return this.language.equals(new Field<String>(language));
	}
}